package chapter02

//编译时常量
const val MAX_EXPERIENCE: Int = 5000

fun main(args: Array<String>) {
    //可变变量
    var experiencePoints: Int = 5
    experiencePoints += 5
    println(experiencePoints)

    //不可变变量
    val playerName = "Estragon"
    println(playerName)

    //类型推断
    //对于省略了类型声明的变量，光标放在变量上，或者 ctrl + shift + P, 可查看变量类型

    //2.9 挑战练习：定义 hasSteed 变量
    var hasSteed: Boolean = false

    //2.10 挑战练习：独角兽之角
    var name = ""
    var boss = ""
    val gold = 50
    var menu = mapOf("a" to 1, "b" to 2.3, "c" to 34.5);

    //2.11 挑战练习：魔镜
    var custom = "Estragon"
    val mirror = with(custom) {
        reversed()
    }
    println(mirror)
}